﻿using System;

namespace tuimg.structs
{
    internal struct struct_jpeg_app0
    {
        internal ushort size;
        internal string type; // 5 chars
        internal byte major_ver;
        internal byte minor_ver;
        internal byte unit;
        internal ushort x_size;
        internal ushort y_size;
        internal byte thumbx_size;
        internal byte thumby_size; //thumbx_size and thumby_size > 0 ; 下方RGB缩略图数据 =  3×thumbx_size×thumby_size
    }
    internal struct struct_jpeg_dqt
    {
        internal ushort size;
        internal byte dq_info; // 0－3位：QT号 , 4－7位：QT精度（0＝8bit，1字节；否则＝16bit，2字节）
        internal ushort[] dq; // n＝64×QT精度的字节数
    }
    internal struct struct_jpeg_sof0
    {
        internal ushort size;
        internal byte accuracy;
        internal ushort height;
        internal ushort width;
    }
    internal enum enum_jpeg_tag : ushort
    {
        SOI = 0xd8ff, // Start of Image
        APP0 = 0xe0ff, // 应用程序保留标记段
        DQT = 0xdbff, // Define Quantization Table
        SOF0 = 0xc0ff, // Start of Frame
        SOF1 = 0xc1ff, // Start of Frame
        DHT = 0xc4ff, // Define Huffman Table
        SOS = 0xdaff, // Start of Scan
        DRI = 0xddff, // 定义重新开始间隔
        COM = 0xfeff, // 注释
        EOI = 0xd9ff, // End of Image
    }
}
